/*!
 * \class TimeInfo
 *
 * \brief 获取时间信息
 *
 * \author Bryceyam
 * \date ʮһ�� 2025
 */
#pragma once
#include <string>
#include <iomanip>

class TimeInfo
{
public:
	/*
	*@brief 获取当前时间
	*@param[in]  fmt时间格式 time_zone时区
	*@return     当前时间
	*/
	std::string GetTimeNow(const char* fmt = "%Y-%m-%d %H:%M:%S", int time_zone = 8);
	
private:
	std::time_t munix_sec_ = std::time(nullptr);
	std::tm mtm_;
	const int mkHoursInDay_{ 24 };
	const int mkMinutesInHour_ = { 60 };
	const int mkDaysFromUnixTime_ = { 2472632 };
	const int mkDaysFromYear_ = { 153 };
	const int mkMagicUnkonwnFirst_ = { 146097 };
	const int mkMagicUnkonwnSec_ = { 1461 };
};

